<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@page import="java.util.*" %>
<%@page import="org.json.*" %>
<%-- show the time of the next few events --%>
<%
String[] addresses = {
	"39111 Cedar Blvd, Newark CA 94560",
	"1600 Amphitheater Pkwy, Mountain View, CA",
	"1400 Crittenden Ln, Mountain View, CA"
};

// randomly select one address
int randomIdx = (int)(System.currentTimeMillis() % addresses.length);
String address = addresses[randomIdx];


// find the time for 5 seconds later
Calendar cal = new GregorianCalendar();
cal.add(Calendar.SECOND, 30);

JSONObject obj = new JSONObject();
obj.put("time", cal.getTime().getTime());
obj.put("title", "Dental Appointment");
obj.put("address", address);
%>

<%=obj.toString(2)%>